import {ForbiddenException} from "@nestjs/common";

/**
 * 非法操作
 */
exports.unvalidOperate = () => {
    throw new ForbiddenException({message: '非法操作'})
};

/**
 * 用户模块错误码
 *
 *  100 - 200
 *
 */
exports.userExist = () => {
    throw new ForbiddenException({message: '用户已存在!', code: 100})
};

exports.emailExist = () => {
    throw new ForbiddenException({message: '邮箱已存在!', code: 101})
};

exports.emailNoExist = () => {
    throw new ForbiddenException({message: '邮箱不能为空!', code: 101})
};

exports.noPasswordExist = () => {
    throw new ForbiddenException({message: '密码不能为空!', code: 101})
};

exports.keyUnValid = () => {
    throw new ForbiddenException({message: '校验码是无效的!', code: 102})
};

exports.loginError = () => {
    throw new ForbiddenException({message: '用户名或者密码错误!', code: 103})
};

exports.accountError = () => {
    throw new ForbiddenException({message: '账户异常无法登陆!', code: 104})
};

exports.passwordError = () => {
    throw new ForbiddenException({message: '密码错误!', code: 105})
};

exports.updateUserError = () => {
    throw new ForbiddenException({message: '更新用户信息失败!', code: 106})
};

exports.tokenError = () => {
    throw new ForbiddenException({message: 'token不合法!', code: 107})
};

exports.tokenExpire = () => {
    throw new ForbiddenException({message: 'token已过期!', code: 108})
};

/**
 * 书签模块
 *
 *  201 - 0
 *
 */

exports.categoryNameExpire = () => {
    throw new ForbiddenException({message: '书签分类必填项不能为空!', code: 201})
};

exports.categoryIDExpire = () => {
    throw new ForbiddenException({message: '书签分类ID不存在!', code: 202})
};

exports.categoryErrExpire = () => {
    throw new ForbiddenException({message: '书签分类操作失败!', code: 203})
};

exports.bookmarkTitleExpire = () => {
    throw new ForbiddenException({message: '书签名称不能为空!', code: 204})
};

exports.bookmarkLinkExpire = () => {
    throw new ForbiddenException({message: '书签链接不能为空!', code: 205})
};

exports.bookmarkCategoryidExpire = () => {
    throw new ForbiddenException({message: '书签分类ID不能为空!', code: 206})
};

exports.bookmarkErrExpire = () => {
    throw new ForbiddenException({message: '书签操作异常!', code: 207})
};

exports.bookmarkIDExpire = () => {
    throw new ForbiddenException({message: '书签ID不能为空!', code: 208})
};

exports.bookmarkNoTagsHoard = () => {
    throw new ForbiddenException({message: '没有tags字段或没有hoard字段', code: 209})
};
